﻿using Furion;
using Furion.DatabaseAccessor;
using LimaLims.EntityFramework.Core.DbContext;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;

namespace LimaLims.EntityFramework.Core
{
    public class Startup : AppStartup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDatabaseAccessor(options =>
            {
                options.CustomizeMultiTenants(); // 自定义租户

                //options.AddDbPool<DefaultDbContext>(providerName: default, optionBuilder: (services, opt) =>
                //{
                //    opt.UseBatchEF_Sqlite(); // EF批量组件 --- SQlite数据库包
                //});

      


                options.AddDbPool<DefaultDbContext>(DbProvider.SqlServer);

                //options.AddDbPool<MultiTenantDbContext, MultiTenantDbContextLocator>(DbProvider.SqlServer);
            }, "LimaLims.Database.Migrations");
        }
    }
}